package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.ComplaintsInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface ComplaintsInfoMapper {
    @Select("SELECT * FROM complaints")
    List<ComplaintsInfo> getComplaintsInfo();

    @Select("SELECT * FROM complaints where Complaint_id = #{Complaint_id}")
    List<ComplaintsInfo> getComplaintsInfoById(Integer Complaint_id);

    @Update("UPDATE complaints SET Complaint_result = #{Complaint_result},operator = #{operator} where Complaint_id = #{Complaint_id}")
    Integer updateComplaintsInfo(ComplaintsInfo complaintsInfo);

    @Delete("delete from complaints where Complaint_id = #{Complaint_id}")
    Integer deleteByID(Integer Complaint_id);
}
